In the Office BASIC window for a dialog that you created, leave the dialog editor by clicking the name tab of the Module that the dialog is assigned to. The name tab is at the bottom of the window.
ダイアログを作成した Office BASIC ウィンドウで、ダイアログを割り当てるモジュール名のタブをクリックして、エディタ画面を切り換えます。モジュール名のタブは、画面の下側に表示されています。
Enter the following code for a subroutine called Dialog1Show. In this example, the name of the dialog that you created is "Dialog1":
下記の Dialog1Show サブルーチンのコードを入力します。なおこの例では、ユーザー定義したダイアログ名を「Dialog1」としています。
Sub Dialog1Show
Sub Dialog1Show
BasicLibraries.LoadLibrary("Tools")
BasicLibraries.LoadLibrary("Tools")
oDialog1 = LoadDialog("Standard", "Dialog1")
oDialog1 = LoadDialog("Standard", "Dialog1")
oDialog1.Execute()
oDialog1.Execute()
End Sub
End Sub
Without using "LoadDialog" you can call the code as follows:
「LoadDialog」を使用しなくても、下記のコードのようにしてダイアログを呼び出すことができます。
Sub Dialog1Show
Sub Dialog1Show
DialogLibraries.LoadLibrary( "Standard" )
DialogLibraries.LoadLibrary( "Standard" )
oDialog1 = CreateUnoDialog( DialogLibraries.Standard.Dialog1 )
oDialog1 = CreateUnoDialog( DialogLibraries.Standard.Dialog1 )
oDialog1.Execute()
oDialog1.Execute()
End Sub
End Sub
When you execute this code, "Dialog1" opens. To close the dialog, click the close button (x) on its title bar.
このコードを実行すると「Dialog1」が開きます。ダイアログを閉じるには、タイトルバーにある閉じるボタン (×) をクリックします。